how to access values of an object with dynamic keys